import math


def dmst_to_degrees(degrees, minutes, seconds):
    return degrees + minutes / 60 + seconds / 3600


def dmst_to_radians(degrees, minutes, seconds):
    return degrees * 3600 + minutes * 60 + seconds


def degrees_to_dmst(degrees):
    degrees = float(degrees)
    minutes = int((degrees - int(degrees)) * 60)
    seconds = (degrees - int(degrees) - minutes / 60) * 3600
    return str(int(degrees)) + "°" + str(minutes) + "\'" + str(round(seconds, 2)) + "\""


def degrees_to_ddfm(degrees):
    degrees = float(degrees)
    minutes = ((degrees - int(degrees)) * 60)
    return int(degrees), minutes


def radians_to_dmst(radians):
    degrees = int(radians / 3600)
    minutes = int((radians - degrees * 3600) / 60)
    seconds = radians - degrees * 3600 - minutes * 60
    return degrees, minutes, seconds


def radians_to_degrees(radians):
    return radians * 180 / math.pi
